#!/bin/bash
services=('clouddriver' 'deck' 'echo' 'fiat' 'front50' 'gate' 'igor' 'orca' 'rosco' 'halyard' 'kayenta')
ports=(7002 9000 8089 7003 8080 8084 8088 8083 8087 8064 8090)
for i in "${!ports[@]}";
do
    PID=$(sh -c "lsof -i:${ports[$i]}|grep -i listen")
    PID=$(echo $PID|awk -F ' ' '{print $2}')
    if [ "$PID" = "" ]
    then
        PID=down
    fi
    echo -e "${services[$i]}\t${ports[$i]} $PID"
done